/**
 * 
 */
package org.jim.core.packets;

import org.jim.core.ImStatus;
import org.jim.core.Status;

/**
 * 版本: [1.0]
 * 功能说明: 
 * 作者: WChao 创建时间: 2017年9月12日 下午3:15:28
 */
public class HttpRespBody extends RespBody {
	
	private static final long serialVersionUID = 1L;
	private String token;
	private User user;

	public HttpRespBody(){

		this.setCommand(Command.COMMAND_GET_HTTP_RESP);
		this.setCode(ImStatus.C10022.getCode());
	}

	public HttpRespBody(Status status){
		this(status,null);
	}

	public HttpRespBody(Status status , User user){
		this(status, user, null);
	}

	public HttpRespBody(Status status , User user, String token){
		super(Command.COMMAND_GET_HTTP_RESP, status);
		this.user = user;
		this.token = token;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public static HttpRespBody success(){
		return new HttpRespBody();
	}

	public static HttpRespBody failed(){
		return new HttpRespBody(ImStatus.C10023);
	}

	public static HttpRespBody failed(String msg){
		HttpRespBody loginRespBody = new HttpRespBody(ImStatus.C10023);
		loginRespBody.setMsg(msg);
		return loginRespBody;
	}
}
